<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>画一椭圆弧且填充</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.imagefilledarc" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagefilledarc</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imagefilledarc</span> &mdash; <span class="dc-title">画一椭圆弧且填充</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagefilledarc-description">
  <h3 class="title">说明</h3>
   <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagefilledarc</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$cx</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$cy</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$width</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$height</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$start</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$end</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$color</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$style</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">在指定的 <code class="parameter">image</code> 上画一椭圆弧且填充。</p>
  </div>

 <div class="refsect1 parameters" id="refsect1-function.imagefilledarc-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<code class="parameter">image</code></dt>

<dd>
<p class="para">由图象创建函数(例如<span class="function"><a href="imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>)返回的图象资源。</p></dd>

    
     <dt>
<code class="parameter">cx</code></dt>

     <dd>

      <p class="para">
       中间的 x 坐标。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">cy</code></dt>

     <dd>

      <p class="para">
       中间的 y 坐标。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">width</code></dt>

     <dd>

      <p class="para">
       椭圆弧的宽度。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">height</code></dt>

     <dd>

      <p class="para">
       椭圆弧的高度。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">start</code></dt>

     <dd>

      <p class="para">
       起点角度。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">end</code></dt>

     <dd>

      <p class="para">
       终点角度。
       0° is located at the three-o&#039;clock position, and the arc is drawn
       clockwise.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">color</code></dt>

     <dd>

      <p class="para">
              <span class="function"><a href="imagecolorallocate.html" class="function">imagecolorallocate()</a></span> 创建的颜色标识符。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">style</code></dt>

     <dd>

      <p class="para">
       值可以是下列值的按位或（OR）：
       <ol type="1">
        <li class="listitem"><span class="simpara"><strong><code>IMG_ARC_PIE</code></strong></span></li>
        <li class="listitem"><span class="simpara"><strong><code>IMG_ARC_CHORD</code></strong></span></li>
        <li class="listitem"><span class="simpara"><strong><code>IMG_ARC_NOFILL</code></strong></span></li>
        <li class="listitem"><span class="simpara"><strong><code>IMG_ARC_EDGED</code></strong></span></li>
       </ol>
  <strong><code>IMG_ARC_PIE</code></strong> 和 <strong><code>IMG_ARC_CHORD</code></strong>
   是互斥的；<strong><code>IMG_ARC_CHORD</code></strong>
   只是用直线连接了起始和结束点，<strong><code>IMG_ARC_PIE</code></strong>
   则产生圆形边界。<strong><code>IMG_ARC_NOFILL</code></strong>
   指明弧或弦只有轮廓，不填充。<strong><code>IMG_ARC_EDGED</code></strong>
   指明用直线将起始和结束点与中心点相连，和 <strong><code>IMG_ARC_NOFILL</code></strong>
   一起使用是画饼状图轮廓的好方法（而不用填充）。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagefilledarc-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.imagefilledarc-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3694">
    <p><strong>Example #1 创建一 3D 效果的饼状图</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;创建图像<br /></span><span style="color: #0000BB">$image&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;分配一些颜色<br /></span><span style="color: #0000BB">$white&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$gray&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xC0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xC0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xC0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$darkgray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x90</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x90</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x90</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$navy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$darknavy&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x50</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$red&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$darkred&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x90</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;创建&nbsp;3D&nbsp;效果<br /></span><span style="color: #007700">for&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">60</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">--)&nbsp;{<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">45</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$darknavy</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">45</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">75&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$darkgray</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">75</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">360&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$darkred</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">45</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$navy</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">45</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">75&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$gray</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagefilledarc</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">75</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">360&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$red</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_ARC_PIE</span><span style="color: #007700">);<br /><br /><br /></span><span style="color: #FF8000">//&nbsp;输出图像<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;image/png'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagedestroy</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imagefilledarc.png" alt="例子输出：创建一 3D 效果的饼状图" width="100" height="100" />
     </div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 notes" id="refsect1-function.imagefilledarc-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。</span></p></blockquote>
 </div>

 </div></div></div></body></html>